print("Нужно ввести любой текст, но со скобками ()!!!")
open2 = ''
close = 0
flag = True
s = input() #()))()()(()() -> 6; 7
for el in s:
    if el == '(' or el =="[":
        open2 += el
    elif el == ')':
        if open2:
            if open2[-1] == "(":
                open2 = open2[:-1]
            
            else:
                flag = False
            break
    elif el == ']':
        if open2:
            if open2[-1] == "[":
                open2 = open2[:-1]
            else:
                flag = False
                
if len(open2) > 0:
    print('Неверная')
elif flag == False:
    print('Неверная')
else:
    print("Верная")
 
